package com.oceanread.cn.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.lang.reflect.Array;

public class ProjectionsTools {
    public JSONObject getinfo(Projections projection){
        JSONObject object=new JSONObject();
        object.put("SYSID",projection.getId());
        object.put("PrjCode",projection.getPrjCode());
        object.put("Name",projection.getName());
        object.put("Abbreviation",projection.getShortName());
        object.put("DateTime",projection.getDate());
        object.put("Type",projection.getType());
        object.put("NumPipeline",projection.getNumPipeline());
        object.put("LengthPipeline",projection.getLengthPipeline());
        object.put("DepthPipeline",projection.getDepthPipeline());
        object.put("NumDrillhole",projection.getNumDrillhole());
        object.put("NumProfile",projection.getNumProfile());
        object.put("UndertakingUnit",projection.getUndertakingUnit());

        float[] centerCoordinate=new float[3];
        try {
            centerCoordinate[0]= Float.parseFloat(projection.getLon());
            centerCoordinate[1]= Float.parseFloat(projection.getLat());
            centerCoordinate[2]= Float.parseFloat(projection.getCameraHight());
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
        object.put("CenterCoordinate",centerCoordinate);
        return object;
    }
}
